package com.rafahead.firstdb.controler;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;

import com.rafahead.firstdb.R;
import com.rafahead.firstdb.persist.DBAdapter;

public class EmpresaActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		DBAdapter db = new DBAdapter(getApplicationContext());
		db.open();

		Long idCategoria = 1L;
		String descricao = "";
		Cursor c = db.consultarCategoria(idCategoria);
		if(c != null){
			descricao = c.getString(c.getColumnIndex(DBAdapter.COLUNA_DESCRICAO_CATEGORIA));
		}

		db.close();
		c.close();

		Log.w("EmprestaAiActivity","Mostrando categoria: "+descricao);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}


}
